import React from 'react';
import { Table,Drawer,Form, Input,Modal,message} from 'antd';


const FormItem = Form.Item;
const { TextArea } = Input;
class Drawers extends React.Component{

    constructor(props){
        super(props);
        this.state={
            visible:false,
            data:{}
        }
    }

    init = (record) => {
        this.setState({
            data:record
        })
    }

    showDrawer = () => {
        this.setState({
          visible: true,
        });
      };

    onClose = () => {
        this.setState({
          visible: false,
        });
      };

    render(){
        return(
            <Drawer
            title="文章"
            placement="right"
            closable={false}
            onClose={this.onClose}
            visible={this.state.visible}
            width="600"
            >
            <Form layout="vertical">

                <FormItem label="标题" className="formitem">
                    <Input  className="inputk" autoComplete="off" value={this.state.data.title}/>
                </FormItem>

                <FormItem label="内容" className="formitem">
                    <TextArea className="inputk" rows={4} value={this.state.data.content}/>
                </FormItem>

                <FormItem label="作者" className="formitem">
                    <Input className="inputk" type="textarea" value={this.state.data.author} autoComplete="off"/>
                </FormItem>

                <FormItem label="类型" className="formitem">
                    <Input className="inputk" type="textarea" value={this.state.data.type} autoComplete="off"/>
                </FormItem>

                <FormItem label="标记" className="formitem">
                    <Input className="inputk" type="textarea" value={this.state.data.sign} autoComplete="off"/>
                </FormItem>
                </Form>
            </Drawer>
        )
    }
}

const ShowDrawer = Form.create({withRef: true})(Drawers);
export default ShowDrawer;